-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drain channel on unsubscribe-all #1
Drain channel on unsubscribe-all #1
Conversation
This makes it easier to use this library without potentially deadlocking.
This makes it easier to use this module without accidentally deadlocking. It's not perfect, but it's better than the current state of things. |
When unsubscribing all topics, pubsub will drain the subscription channel to avoid deadlocks. See whyrusleeping/pubsub#1. fixes #7803
When unsubscribing _all_ topics, pubsub will drain the subscription channel to avoid deadlocks. See whyrusleeping/pubsub#1. fixes #7803
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm, seems like we might be covering up some bad usage patterns with this, but less footguns is good
Well, the only other way to do this is to spawn a goroutine to unsubscribe while we continue to read from the channel. |
When unsubscribing _all_ topics, pubsub will drain the subscription channel to avoid deadlocks. See whyrusleeping/pubsub#1. fixes #7803
And: